var twoSum = function(nums, target) {
    let indexs = [],index2
    let _value
     _nums.some((item,index)=>{
         _value = target - item
         index2 = _nums.findIndex((id,index2)=> id===_value)
         if(index2 > -1 && index2 !=index){indexs[0]=index;indexs[1] = index2}
         return index2 > -1 && index2 !=index
    });
    return indexs
}

/**
 * @param {number} x
 * @return {number}
 */
var reverse = function(x) {
    let a = Array.from(''+Math.abs(x)).reverse()
    let b = parseInt(a.join(''))
    if(isNaN(b)||b=== Infinity){
        return 0
    }
    return x >0 ? b:-b
};



